//
//  LXTestViewController.m
//  LvXi_newVersion
//
//  Created by 诸葛孔明 on 16/8/9.
//  Copyright © 2016年 SJT. All rights reserved.
//

#import "LXTestViewController.h"
#import "LXLoginViewController.h"
#import "LXMineViewController.h"
#import "LXMineCenterButton.h"
#import "LXGreenBeanButton.h"

@interface LXTestViewController ()

@end

@implementation LXTestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeContactAdd];
    addBtn.frame = CGRectMake(100, 100, 100, 100);
    [addBtn addTarget:self action:@selector(addBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:addBtn];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setTitle:@"点我" forState:UIControlStateNormal];
    [button setBackgroundColor:[UIColor orangeColor]];
    button.frame = CGRectMake(200, 200, 50, 50);
    [button addTarget:self action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    LXMineCenterButton *mineButton = [[LXMineCenterButton alloc] init];
    [mineButton setImage:[UIImage imageNamed:@"payment"] forState:UIControlStateNormal];
    [mineButton setTitle:@"代付款" forState:UIControlStateNormal];
    mineButton.frame = CGRectMake(100, 400, 50, 50);
    [mineButton addTarget:self action:@selector(mineBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:mineButton];
    
    LXGreenBeanButton *GreenBeanButton = [[LXGreenBeanButton alloc] init];
    GreenBeanButton.numberLabel.text = @"1000";
    GreenBeanButton.nameLabel.text = @"我的佣金";
    GreenBeanButton.frame = CGRectMake(100, 500, MineRatio(115), MineRatio(115));

    [GreenBeanButton addTarget:self action:@selector(mineBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:GreenBeanButton];
}

- (void)mineBtnClick
{   
    NSLog(@"%s------",__func__);
}

- (void)buttonClick
{
    LXMineViewController *mineVc = [[LXMineViewController alloc] init];
        [self.navigationController pushViewController:mineVc animated:YES];
}

- (void)addBtnClick
{
    LXLoginViewController *loginVc = [[LXLoginViewController alloc] initWithNibName:NSStringFromClass([LXLoginViewController class]) bundle:[NSBundle mainBundle]];
    [self presentViewController:loginVc animated:YES completion:nil];
//    [self.navigationController pushViewController:loginVc animated:YES];
}

@end
